﻿/*
 * PsTFS is a set of PowerShell commands to manage and use Team Foundation Server. PowerShell 
 * effectiveness is combined with the power of TFS API to maximizes TFS capabilities.
 * 
 * Creator : Choulant Noham
 * Mail : choulant@gmail.com
 * Blog : http://choulant.blogspot.com
 * 
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
using System.Collections;
using Microsoft.TeamFoundation.Server;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
using PowerShell.Host.PsTFS.CdmLet.PsObject;
using Microsoft.SharePoint;

namespace PowerShell.Host.PsTFS.CdmLet
{
    /// <summary>
    /// Liste des membres d'un projet
    /// </summary>
    [Cmdlet(VerbsCommon.Get, "IGroupSecurityService")]
    public class Get_IGroupSecurityService : Cmdlet
    {
        public Get_IGroupSecurityService()
        {
            if (TFSProvider.s_TFSDriveInfo != null)
            {
                this.TFS = TFSProvider.s_TFSDriveInfo.TFS;
            }
        }
        protected override void ProcessRecord()
        {
            if (TFS == null)
            {
                WriteError(new ErrorRecord(new ArgumentException("No server TFS!!!"), "PsTFS", ErrorCategory.ObjectNotFound, TFS));
            }
            WriteObject(PsService.IGSS(TFS));
        }


        /// <summary>
        /// Permet de récupérer la fin de la commande
        /// </summary>
        protected override void EndProcessing()
        {
            PsLog.AddLog(null, "Get-IGroupSecurityService is end");
            base.EndProcessing();
        }

        [Parameter(Position = 0)]
        public TeamFoundationServer TFS { get; set; }
    }
}


